package net.xdclass.service;

import net.xdclass.model.CouponRecordDO;
import com.baomidou.mybatisplus.extension.service.IService;
import net.xdclass.model.CouponRecordMessage;
import net.xdclass.request.LockCouponRecordRequest;
import net.xdclass.util.JsonData;
import net.xdclass.vo.CouponRecordVo;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 孙浩
 * @since 2022-04-20
 */
public interface CouponRecordService extends IService<CouponRecordDO> {

  /**
   * 分页查询领券记录
   * @param page
   * @param size
   * @return
   */
  Map<String,Object> pageData(int page, int size);

  /**
   * 根据Id查询领券记录详情
   * @param recordId
   * @return
   */
  CouponRecordVo findById(long recordId);


  /**
   * 锁定优惠券领取记录
   * @param couponRecordRequest
   * @return
   */
  JsonData lockRecords(LockCouponRecordRequest couponRecordRequest);


  /**
   * 释放优惠券领取记录
   * @param recordMessage
   * @return
   */
  boolean releaseCouponRecord(CouponRecordMessage recordMessage);
}
